# Copyright 2022 The XFL Authors. All rights reserved.
# 
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# 
#     http://www.apache.org/licenses/LICENSE-2.0
# 
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.


# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc

import commu_pb2 as commu__pb2
import control_pb2 as control__pb2
import status_pb2 as status__pb2


class TrainerStub(object):
    """Missing associated documentation comment in .proto file."""

    def __init__(self, channel):
        """Constructor.

        Args:
            channel: A grpc.Channel.
        """
        self.post = channel.stream_unary(
                '/trainer.Trainer/post',
                request_serializer=commu__pb2.PostRequest.SerializeToString,
                response_deserializer=commu__pb2.PostResponse.FromString,
                )
        self.control = channel.unary_unary(
                '/trainer.Trainer/control',
                request_serializer=control__pb2.ControlRequest.SerializeToString,
                response_deserializer=control__pb2.ControlResponse.FromString,
                )
        self.status = channel.unary_unary(
                '/trainer.Trainer/status',
                request_serializer=status__pb2.StatusRequest.SerializeToString,
                response_deserializer=status__pb2.StatusResponse.FromString,
                )


class TrainerServicer(object):
    """Missing associated documentation comment in .proto file."""

    def post(self, request_iterator, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def control(self, request, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def status(self, request, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_TrainerServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'post': grpc.stream_unary_rpc_method_handler(
                    servicer.post,
                    request_deserializer=commu__pb2.PostRequest.FromString,
                    response_serializer=commu__pb2.PostResponse.SerializeToString,
            ),
            'control': grpc.unary_unary_rpc_method_handler(
                    servicer.control,
                    request_deserializer=control__pb2.ControlRequest.FromString,
                    response_serializer=control__pb2.ControlResponse.SerializeToString,
            ),
            'status': grpc.unary_unary_rpc_method_handler(
                    servicer.status,
                    request_deserializer=status__pb2.StatusRequest.FromString,
                    response_serializer=status__pb2.StatusResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'trainer.Trainer', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class Trainer(object):
    """Missing associated documentation comment in .proto file."""

    @staticmethod
    def post(request_iterator,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.stream_unary(request_iterator, target, '/trainer.Trainer/post',
            commu__pb2.PostRequest.SerializeToString,
            commu__pb2.PostResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def control(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/trainer.Trainer/control',
            control__pb2.ControlRequest.SerializeToString,
            control__pb2.ControlResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def status(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/trainer.Trainer/status',
            status__pb2.StatusRequest.SerializeToString,
            status__pb2.StatusResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
